//
//  Tab1Controller.m
//  newView
//
//  Created by yjl on 14-6-20.
//  Copyright (c) 2014年 上海傲融软件公司. All rights reserved.
//

#import "Tab1Controller.h"
#import "UIDevice+Resolutions.h"



@interface Tab1Controller ()

@end

@implementation Tab1Controller

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    CGRect barRect = [UIDevice getStatusBarFrame];
    CGRect appRect = [UIDevice getAppFrame];
    CGRect scrollrect = CGRectMake(0,0, appRect.size.width, appRect.size.height);
    self.scrollView = [[UIScrollView alloc]initWithFrame:scrollrect];
    self.scrollView.contentSize = CGSizeMake(appRect.size.width, appRect.size.height+180);
    [self.view addSubview:self.scrollView];
    CGRect krect = CGRectMake(0, 0, appRect.size.width, 180);
    self.kenburnsView = [[CPKenburnsView alloc] initWithFrame:krect];
    self.kenburnsView.image = [UIImage imageNamed:@"1.jpg"];
    [self.scrollView addSubview:self.kenburnsView];
    
    CGRect webrect = CGRectMake(0, 180, appRect.size.width, appRect.size.height-49);
    self.webView = [[UIWebView alloc]initWithFrame:webrect];
    NSString* path = [[NSBundle mainBundle] pathForResource:@"food1" ofType:@"html" inDirectory:@"www/food1"];
    NSURL *nsurl = [NSURL fileURLWithPath:path];
    [self.scrollView addSubview:self.webView];
    [self.webView loadRequest:[NSURLRequest requestWithURL:nsurl]];
    
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
